<template>
    <el-container>
        <el-aside class="aside">
            <CommonAside />
        </el-aside>
        <el-container>
            <el-header class="header">
                <CommonHeader />
            </el-header>
            <el-main class="main">
                <!-- 路由出口 -->
                <!-- 路由匹配到的组件将渲染在这里 -->
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script>
import CommonAside from '../components/CommonAside.vue'
import CommonHeader from '../components/CommonHeader.vue'

export default {
    data() {
        return {}
    },
    components: {
        CommonAside,
        CommonHeader
    },
    created() {
        // 在应用初始化时执行的操作
        console.log('应用初始化');

        this.$store.commit('initMenu');
        // 检查是否存在存储的用户信息，并更新state
        this.$store.commit('initUserData');

        // 检查是否存在存储的result，并更新state
        this.$store.commit('initResult');

        this.$store.commit('initImport');
    }
}
</script>

<style lang="less">
.el-container {
    .aside {
        box-shadow: 5px 0 5px rgba(0, 0, 0, 0.1);
        width: auto !important;
        z-index: 2;
        background-color: #fff;
    }

    .header {
        box-shadow: 5px 0 5px rgba(0, 0, 0, 0.1);
        z-index: 1;
        width: auto !important;
    }

    .el-header {
        padding: 0 !important;
    }
}
</style>
